<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$head[title]}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="{$head[keywords]}" name="keywords" />
<meta content="{$head[description]}" name="description" />
<base href="{SITE_URL}" />
<link href="favicon.ico" rel="shortcut icon" />
<link href="../skin/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="{$head[title]}" href="/rss.php?rssid={$catid}" />
<script language="JavaScript" src="misc/config.js"></script>
<script language="JavaScript" src="misc/jquery.min.js"></script>
<script language="JavaScript" src="misc/common.js"></script>
<script language="JavaScript" src="misc/validator.js"></script>
<link href="{SKIN_PATH}modal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="images/js/jqModal.js"></script>
</head>
<body>

{template 'header.html'}

<div class="container">

	<div class="aside">
    	
    </div>
    
    <div class="main">
    	<div><a href="{$M[url]}">问吧首页</a>我要提问</div>
    
        <table cellpadding="0" cellspacing="6" width="100%">
        <form name="myform" method="post" action="{url("?module=ask&action=question")}" onSubmit="return checkform(this);">
          <tr>
            <th width="90">您的问题</th>
            <td><input type="text" name="info[title]" id="title" value="{$title}" size="50"></td>
          </tr>
          <tr>
            <th style="vertical-align:top">问题补充</th>
            <td><textarea name="message" id="message" rows="9" cols="60" ></textarea>
            {if $M[use_editor]}{form::editor('message','introduce','100%',200,0)}{/if}
            </td>
          </tr>
          <tr>
            <th style="vertical-align:top">问题分类</th>
            <td>
            <span id="load_catid"></span>
            <input type="hidden" name="info[catid]" id="catid" value="">
            <a href="javascript:category_reload();">重选</a>
    		<script type="text/javascript">
            function category_load(id)
            {
                $.get('?module=ask&action=load', { id: id },
                      function(data){
                        $('#load_catid').append(data);
                      });
            }
            category_load(0);
    </script>
            </td>
          </tr>
          <tr>
            <th>悬赏积分</th>
            <td><select name="info[reward]" id="reward"  onchange="ckreward();">
        <option value=0>0</option>
        <option value=5>5</option>
        <option value=10>10</option>
        <option value=15>15</option>
        <option value=20>20</option>
        <option value=30>30</option>
        <option value=45>45</option>
        <option value=60>60</option>
        <option value=80>80</option>
        <option value=100>100</option>
    </select>( 注：您目前的总积分为：{$_point} )
    <span id="reward_msg"></span></td>
          </tr>
          <tr>
            <th>匿名设定</th>
            <td><input type="checkbox" id="anonymity" onClick="checkAnonymity();" name="info[anonymity]" value="1">您可以对问题设定匿名，但您需要付出积分{$M[anybody_score]}分。<span id="anonymity_msg"></span></td>
          </tr>
          {if $M[publish_code]}
          <tr>
            <th>验证码</th>
            <td id="reg_code">{form::checkcode('checkcodestr',5)}
            </td>
          </tr>
          {/if}
          <tr>
            <th></th>
            <td><input type="hidden" name="forward" value="{$forward}"><input name="dosubmit" type="submit" value="好了，提交" /></td>
          </tr>
          </form>
        </table>
    </div>

</div>

<script language="javascript">
<!--
function checkform()
{
	if($('#title').val() == '')
	{
		alert("标题不能为空");
		$('#title').focus();
		return false;
	}
	if($('#catid').val() == 0)
	{
		alert("请选择分类");
		$('#catid').focus();
		return false;
	}
}
function ckreward()
{
	if($('#reward').val() != "" && $('#reward').val() > {$_point})
	{
		$('#reward_msg').html("<font color='red'><strong>抱歉,悬赏不能高于您目前的总积分.</strong></font>");
		return false;
	}
	else
	{
		$('#reward_msg').html("");
		return true;
	}
}
function checkAnonymity()
{
	if($('#anonymity').attr('checked')==true)
	{
		var _points = {$_point};
		if(_points < {$M[anybody_score]})
		{
			$('#anonymity_msg').html("<font color='red'><strong>抱歉,您的积分不足以设置匿名.</strong></font>");
			$('#anonymity').attr('checked',false);
		}
	}
}

$().ready(function() {
	  $('form').checkForm(1);
});
//-->
</script>

{template 'footer.html'}